<template>
  <div class="service-cata">
     <img class="adv" v-if="isImg" :src="content"/>
     <div v-if="!isImg" v-html="content"></div>
  </div>
</template>

<script>
/**
 * 服务目录
 */
import {getServiceDetail} from '@/api/warning';
import getParam from '@/utils/getParam';

export default {
  name: 'ServiceCata',
  data() { 
    return {
      content: '',
    };
  },
  computed: {
    isImg() {
      return this.content.startsWith('http');
    }
  },
  created() {
    this.$store.commit('set_top_title','服务详情');
  },
  mounted() {
    getServiceDetail({
      service_id: getParam('service_id') // '068e2d907375393375d9c026e5e4ce0c'
    }).then((res) => {
       res.data && (this.content = res.data[0].content);
    })
  },
};
</script>

<style>
.service-cata{
  padding: 19px;
  text-align: left;
  margin-bottom: 52px;
  font-size:14px;
  color: #222;
}
.service-cata .adv {
  width: 100%;
}
</style>